RWTH - Mindstorms NXT Toolbox

SetMotor

Sets the current motor to use for motor setting commands

Contents

Syntax

SetMotor(port)

Description

SetMotor(port) sets the current motor on the given port as the current active motor which can be controlled by SendMotorSettings. Changing motor settings take only an effect on the active motor. The value port can be addressed by the symbolic constants MOTOR_A , MOTOR_B and MOTOR_C analog to the labeling on the NXT Brick.

The current motor setting can be returned by function GetMotor.

Example

   SetMotor(MOTOR_C);
   	SetPower(76);
   	SetAngleLimit(720);
   SendMotorSettings();

See also

GetMotor, SendMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C

Signature